package com.qf.test2;

import com.qf.entity.Dept;
import com.qf.entity.Emp;
import com.qf.service.DeptService;
import com.qf.service.EmpService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

/**
 * 2019/9/29
 * Administrator
 * springdata0928
 * 面向对象面向君  不负代码不负卿
 */
public class Demo2 {
    public static void main(String[] args) {

        ApplicationContext applicationContext=
                new ClassPathXmlApplicationContext("spring-data.xml");
        EmpService empService = (EmpService) applicationContext.getBean("empservice");

        Emp emp = empService.findbyname("张三");
        System.out.println(emp);
        System.out.println(emp.getDept().getDeptName());


        List<Emp> empList = empService.findbydname("教学部");
        System.out.println("----------------------------");
        for (Emp emp1 : empList) {

            System.out.println(emp1);
        }

    }
}
